home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / library / help / tcl / variables / stdvars < prev    next >
Encoding:
Text File  |  1993-10-26  |  6.5 KB  |  120 lines  |  [TEXT/$Tcl]

  1.  
  2.  
  3.  
  4.      DESCRIPTION
  5.           The following  global  variables  are  created  and  managed
  6.           automatically by the Tcl library.  Except where noted below,
  7.           these variables should normally be treated as  read-only  by
  8.           application-specific code and by users.
  9.  
  10.           env
  11.                This variable is maintained by Tcl as  an  array  whose
  12.                elements are the environment variables for the process.
  13.                Reading  an  element  will  return  the  value  of  the
  14.                corresponding environment variable.  Setting an element
  15.                of the array will modify the corresponding  environment
  16.                variable  or  create  a  new  one if it doesn't already
  17.                exist.  Unsetting an element of  env  will  remove  the
  18.                corresponding environment variable.  Changes to the env
  19.                array will affect the environment passed to children by
  20.                commands  like  exec.  If the entire env array is unset
  21.                then Tcl will stop monitoring env accesses and will not
  22.                update environment variables.
  23.  
  24.           errorCode
  25.                After an error has occurred, this variable will be  set
  26.                to  hold  additional  information  about the error in a
  27.                form that is easy to process with programs.   errorCode
  28.                consists  of a Tcl list with one or more elements.  The
  29.                first element of the list identifies a general class of
  30.                errors,  and  determines  the format of the rest of the
  31.                list.  The following formats for errorCode are used  by
  32.                the  Tcl core; individual applications may define addi-
  33.                tional formats.
  34.  
  35.                ARITH code msg
  36.                     This format  is  used  when  an  arithmetic  error
  37.                     occurs  (e.g.  an attempt to divide by zero in the
  38.                     expr command).  Code identifies the precise  error
  39.                     and  msg  provides a human-readable description of
  40.                     the error.  Code will be either  DIVZERO  (for  an
  41.                     attempt to divide by zero), DOMAIN (if an argument
  42.                     is outside the  domain  of  a  function,  such  as
  43.                     acos(-3)),   IOVERFLOW   (for  integer  overflow),
  44.                     OVERLFLOW (for a floating-point overflow), or UNK-
  45.                     NOWN  (if  the cause of the error cannot be deter-
  46.                     mined).
  47.  
  48.                CHILDKILLED pid sigName msg
  49.                     This format is used when a child process has  been
  50.                     killed because of a signal.  The second element of
  51.                     errorCode will be  the  process's  identifier  (in
  52.                     decimal).   The third element will be the symbolic
  53.                     name of the signal that caused the process to ter-
  54.                     minate;  it  will  be  one  of  the names from the
  55.                     include  file  signal.h,  such  as  SIGPIPE.   The
  56.                     fourth element will be a short human-readable mes-
  57.                     sage describing the signal,  such  as  ``write  on
  58.                     pipe with no readers'' for SIGPIPE.
  59.  
  60.                CHILDSTATUS pid code
  61.                     This format is  used  when  a  child  process  has
  62.                     exited  with  a  non-zero exit status.  The second
  63.                     element of errorCode will be the  process's  iden-
  64.                     tifier  (in decimal) and the third element will be
  65.                     the exit code returned by  the  process  (also  in
  66.                     decimal).
  67.  
  68.                CHILDSUSP pid sigName msg
  69.                     This format is used when a child process has  been
  70.                     suspended because of a signal.  The second element
  71.                     of errorCode will be the process's identifier,  in
  72.                     decimal.   The  third element will be the symbolic
  73.                     name of the signal  that  caused  the  process  to
  74.                     suspend;  this  will  be one of the names from the
  75.                     include  file  signal.h,  such  as  SIGTTIN.   The
  76.                     fourth element will be a short human-readable mes-
  77.                     sage describing the signal, such  as  ``background
  78.                     tty read'' for SIGTTIN.
  79.  
  80.                NONE
  81.                     This format is used for errors where no additional
  82.                     information  is available for an error besides the
  83.                     message returned with the error.  In  these  cases
  84.                     errorCode will consist of a list containing a sin-
  85.                     gle element whose contents are NONE.
  86.  
  87.                POSIX errName msg
  88.                     If the first element of errorCode is  POSIX,  then
  89.                     the  error  occurred  during  a POSIX kernel call.
  90.                     The second element of the list  will  contain  the
  91.                     symbolic  name of the error that occurred, such as
  92.                     ENOENT; this will be one of the values defined  in
  93.                     the  include  file  errno.h.  The third element of
  94.                     the  list  will  be   a   human-readable   message
  95.                     corresponding  to  errName, such as ``no such file
  96.                     or directory'' for the ENOENT case.
  97.  
  98.                To set errorCode, applications should use library  pro-
  99.                cedures such as Tcl_SetErrorCode and Tcl_PosixError, or
  100.                they may invoke the error command.   If  one  of  these
  101.                methods hasn't been used, then the Tcl interpreter will
  102.                reset the variable to NONE after the next error.
  103.  
  104.           errorInfo
  105.                After an error has occurred, this string  will  contain
  106.                one or more lines identifying the Tcl commands and pro-
  107.                cedures that were being executed when the  most  recent
  108.                error  occurred.  Its contents take the form of a stack
  109.                trace showing the various nested Tcl commands that  had
  110.                been invoked at the time of the error.
  111.  
  112.           tcl_precision
  113.                If this variable is set,  it  must  contain  a  decimal
  114.                number  giving  the  number  of  significant  digits to
  115.                include  when  converting  floating-point   values   to
  116.                strings.  If this variable is not set then 6 digits are
  117.                included.  17 digits is ``perfect'' for IEEE  floating-
  118.                point  in  that it allows double-precision values to be
  119.                co
  120.